String.prototype.capitalize = function() {
    return this.charAt(0).toUpperCase() + this.slice(1);
}

String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g,"");
}

String.prototype.ltrim = function() {
    return this.replace(/^\s+/,"");
}

String.prototype.rtrim = function() {
    return this.replace(/\s+$/,"");
}

Array.prototype.max = function( ){
    return Math.max.apply( Math, this );
};

Array.prototype.min = function( ){
    return Math.min.apply( Math, this );
};

Date.prototype.addDays = function(days) {
    this.setDate(this.getDate() + days);
    return this;
};